package com.estate.struts.actions;

import com.estate.business.PriceProjectService;

public class MultiDelInPriceAction extends EstateSupport {

	private String delStr;
	private PriceProjectService priceProjectService;
	private String currentPage;
	private String multiDelete;
	private String deleteId;

	public String execute() throws Exception {
		if ("true".equals(multiDelete)) {
			System.out.println("!!!!!!!!!"+delStr);
			if (delStr != null && !"".equals(delStr) && !",".equals(delStr)) {
				String[] delArray = delStr.split(",");
				for (int i = 0; i < delArray.length; i++) {
					priceProjectService.deleteByPK(Integer
							.parseInt(delArray[i]));
				}
			}
		} else {
			priceProjectService.deleteByPK(Integer.parseInt(deleteId));
		}
		return this.getCurrentPage();
	}

	public void setDelStr(String delStr) {
		this.delStr = delStr;
	}

	public String getDelStr() {
		return delStr;
	}

	public void setPriceProjectService(PriceProjectService priceProjectService) {
		this.priceProjectService = priceProjectService;
	}

	public PriceProjectService getPriceProjectService() {
		return priceProjectService;
	}

	public void setCurrentPage(String currentPage) {
		this.currentPage = currentPage;
	}

	public String getCurrentPage() {
		return currentPage;
	}

	public void setDeleteId(String deleteId) {
		this.deleteId = deleteId;
	}

	public String getDeleteId() {
		return deleteId;
	}

	public void setMultiDelete(String multiDelete) {
		this.multiDelete = multiDelete;
	}

	public String getMultiDelete() {
		return multiDelete;
	}

}
